package com.sample;


import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;

import java.io.IOException;
import java.net.InetSocketAddress;

public class HadoopClient {
    public static final String IP = "localhost";
    public static final int PORT = 8808;

    public static void main(String[] args) {
        InetSocketAddress inetSocketAddress = new InetSocketAddress(IP, PORT);

        try {
            String sid = "G20210735010048";
            RpcInterface proxy = RPC.getProxy(
                    RpcInterface.class,RpcInterface.versionID, inetSocketAddress,
                    new Configuration());
            String result = proxy.getStudentName(sid);
            System.out.println("the Student name is "+ result);

            RPC.stopProxy(proxy);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
